Skip to content

perf(@angular/build): enable TypeScript incremental build cache in library builder - #34316

Open
alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:feat/library-persistent-cache
Open

alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:feat/library-persistent-cache

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Pass the normalized cacheOptions.path to compilationInstance.initialize when persistent disk caching is enabled so TypeScript writes and reuses .tsbuildinfo across builds.

@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/build labels Oct 12, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables persistent caching for the library builder by extracting cacheOptions and passing cachePath to the compilation options when caching is enabled. It also adds an integration test to verify that .tsbuildinfo is correctly written and reused. The review feedback recommends using optional chaining when accessing cacheOptions to prevent potential runtime TypeErrors if cacheOptions is undefined.

Comment thread packages/angular/build/src/builders/library/pipeline/compilation.ts
@alan-agius4
alan-agius4 requested a review from clydin October 12, 2026 13:17
@alan-agius4 alan-agius4 added target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 12, 2026
@alan-agius4
alan-agius4 force-pushed the feat/library-persistent-cache branch 2 times, most recently from 133ef72 to c5703f5 Compare October 13, 2026 07:29
@alan-agius4
alan-agius4 requested review from clydin and removed request for clydin October 13, 2026 12:08
…brary builder

Pass the normalized `cacheOptions.path` to `compilationInstance.initialize` when persistent disk caching is enabled so TypeScript writes and reuses `.tsbuildinfo` across builds.
@alan-agius4
alan-agius4 force-pushed the feat/library-persistent-cache branch from c5703f5 to 93fef8b Compare October 13, 2026 13:57
@alan-agius4
alan-agius4 requested review from dgp1130 and removed request for clydin October 13, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/build area: performance Issues related to performance target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant